ALMaSS  1.0
The Animal, Landscape and Man Simulation System
CfgInt Class Reference

Integer configurator entry class. More...

#include <configurator.h>

Inheritance diagram for CfgInt:
CfgBase

Public Member Functions

 CfgInt (const char *a_key, CfgSecureLevel a_level, int a_defval)
 
 CfgInt (const char *a_key, CfgSecureLevel a_level, int a_defval, int a_min, int a_max)
 
int value (void)
 
virtual void set (int a_newval)
 
virtual CfgType gettype (void)
 
- Public Member Functions inherited from CfgBase
 CfgBase (const char *a_key, CfgSecureLevel a_level)
 
virtual ~CfgBase (void)
 
const string getkey (void)
 
CfgSecureLevel getlevel (void)
 

Protected Attributes

int m_int
 
int m_max
 
int m_min
 
- Protected Attributes inherited from CfgBase
string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 

Detailed Description

Integer configurator entry class.

Constructor & Destructor Documentation

◆ CfgInt() [1/2]

CfgInt::CfgInt ( const char *  a_key,
CfgSecureLevel  a_level,
int  a_defval 
)
94  :CfgBase(a_key, a_level)
95 {
96  m_int = a_defval;
97 }
CfgBase(const char *a_key, CfgSecureLevel a_level)
Definition: configurator.cpp:73
int m_int
Definition: configurator.h:90

References m_int.

◆ CfgInt() [2/2]

CfgInt::CfgInt ( const char *  a_key,
CfgSecureLevel  a_level,
int  a_defval,
int  a_min,
int  a_max 
)

Constructor with max min checking enabled

99  :CfgBase(a_key, a_level)
100 {
102  m_min = a_min;
103  m_max = a_max;
104  m_rangetest = true;
105  set(a_defval);
106 }
bool m_rangetest
Definition: configurator.h:73
int m_min
Definition: configurator.h:92
virtual void set(int a_newval)
Definition: configurator.cpp:108
int m_max
Definition: configurator.h:91

References m_max, m_min, CfgBase::m_rangetest, and set().

Member Function Documentation

◆ gettype()

virtual CfgType CfgInt::gettype ( void  )
inlinevirtual

Reimplemented from CfgBase.

100 { return CFG_INT; }
@ CFG_INT
Definition: configurator.h:53

References CFG_INT.

◆ set()

void CfgInt::set ( int  a_newval)
virtual
108  {
109  if (m_rangetest) {
110  if ((a_newval<m_min) || (a_newval>m_max))
111  {
112  g_msg->Warn(WARN_FILE, "CfgInt::set Value out of range: ", a_newval);
113  g_msg->Warn(WARN_FILE, "CfgInt::set Max allowed: ", m_max);
114  g_msg->Warn(WARN_FILE, "CfgInt::set Min allowed: ", m_min);
115  }
116  }
117  m_int = a_newval;
118 }
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
class MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
@ WARN_FILE
Definition: maperrormsg.h:37

References g_msg, m_int, m_max, m_min, CfgBase::m_rangetest, MapErrorMsg::Warn(), and WARN_FILE.

Referenced by CfgInt().

◆ value()

int CfgInt::value ( void  )
inline
98 { return m_int; }

Referenced by Partridge_Covey::ActOnParentDeath(), Landscape::AddBeetleBanks(), Hare_Female::AllYoungKilled(), Hare_Female::AllYoungMatured(), Goose_Population_Manager::BangAtPoly(), Landscape::BeetleBankAdd(), Landscape::BeetleBankPossible(), Population_Manager::BeginningOfMonth(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), Partridge_Covey::BeginStep(), Rabbit_Base::BeginStep(), Bembidion_Population_Manager::Bembidion_Population_Manager(), Landscape::BorderAdd(), Landscape::BuildingDesignationCalc(), Vole_Male::CanFeed(), Bembidion_Population_Manager::Catastrophe(), THare_Population_Manager::Catastrophe(), Partridge_Population_Manager::Catastrophe(), Skylark_Population_Manager::Catastrophe(), Vole_Population_Manager::Catastrophe(), Partridge_Chick::ChDeveloping(), Partridge_Chick2::ChDeveloping(), Partridge_Covey::ChickExtraMortality(), Partridge_Clutch::ClDeveloping(), Partridge_Covey::CoveyIndividualEmigrate(), FarmManager::CreateFarms(), Rabbit_Population_Manager::CreateLocalWarrenNetworkLists(), Bembidion_Egg_List::DailyMortality(), Partridge_Base::DailyMortality(), Bembidion_Adult::DDepMort(), Pesticide::DiffusionMaskInit(), Pesticide::DiffusionMaskInitTest(), Vole_JuvenileMale::Dispersal(), Vole_Male::Dispersal(), Vole_JuvenileFemale::Dispersal(), Hunter_Population_Manager::DistributeHunters(), Hunter_Population_Manager::DistributeHuntersByRules(), Partridge_Population_Manager::DoAfter(), THare_Population_Manager::DoAlmostLast(), Partridge_Population_Manager::DoAlmostLast(), Orchard::DoDevelopment(), OrchardBand::DoDevelopment(), MownGrass::DoDevelopment(), Goose_Population_Manager::DoEmigration(), THare_Population_Manager::DoFirst(), Newt_Population_Manager::DoFirst(), Partridge_Population_Manager::DoFirst(), Rabbit_Population_Manager::DoFirst(), Skylark_Population_Manager::DoFirst(), Vole_Population_Manager::DoFirst(), Goose_Population_Manager::DoFirst(), Goose_Population_Manager::DoImmigration(), Goose_Population_Manager::DoLast(), Rabbit_Population_Manager::DoLast(), Bembidion_Population_Manager::DoLast(), RodenticideManager::DoPlaceBait(), Configurator::DumpSymbols(), Partridge_Population_Manager::EvalHabitatQual(), FarmManager::FarmManagement(), Partridge_Female::FBuildingUpResources(), Partridge_Female::FFindingTerritory(), Partridge_Population_Manager::FillInFoodArray(), Vole_Population_Manager::FindOutsideRadiusMale(), Vole_Population_Manager::FindWithinRadiusMale(), Partridge_Covey::FlyToFast(), Partridge_Covey::FlyToSlow(), Partridge_Female::FMakingNest(), THare::Forage(), THare::ForageP(), Partridge_Female::FStartingNewBrood(), LE::GetGooseNos(), Goose_Population_Manager::GetImmigrationNumbers(), LE::GetQuarryNos(), FarmManager::GetSpilledGrain(), Landscape::GISASCII_Output(), Hare_Female::GiveBirth(), Goose_Population_Manager::Goose_Population_Manager(), GooseHunter::GooseHunter(), GooseMemoryMap::GooseMemoryMap(), Partridge_Covey::HabitatEvalPoly(), Partridge_Covey::HabitatEvaluate(), Farm::HandleEvents(), OptimisingFarm::HandleEvents(), Landscape::hb_GenerateHBPolys(), Landscape::hb_StripingDist(), Partridge_Population_Manager::HuntingDifferentiatedBeetleBankArea(), THare_Population_Manager::HuntingDifferentiatedBeetleBankArea(), Partridge_Population_Manager::HuntingGrid(), THare_Population_Manager::HuntingGrid(), Goose_Population_Manager::InHuntingSeason(), THare_Population_Manager::Init(), Goose_Base::Init(), Hunter::Init(), Vole_Base::Init(), Bembidion_Population_Manager::Init(), Partridge_Population_Manager::Init(), Skylark_Population_Manager::Init(), Vole_Population_Manager::Init(), Farm::InitiateManagement(), Hunter::IsTodayAPreferredHuntDay(), Landscape::Landscape(), Skylark_Population_Manager::LoadParameters(), Partridge_Population_Manager::MaleImmigration(), Partridge_Covey::ManagerCheckMerge(), RasterMap::Manipulation1(), Hare_Female::Mating(), Partridge_Male::MFindingMate(), Partridge_Covey::MoveEvalEdgesAndQual(), Partridge_Covey::MoveSelectFuzzy(), Partridge_Covey::MoveSelectLimit(), THare_Population_Manager::MRROutputs(), Partridge_Covey::NestFindFast(), Partridge_Covey::NestFindLocation(), Partridge_Covey::NestFindSlow(), Partridge_Covey::NestGoodSpot(), Partridge_Covey::NestNearBadAreas(), Newt_Population_Manager::Newt_Population_Manager(), Bembidion_Larvae::OnFarmEvent(), Bembidion_Pupae::OnFarmEvent(), Bembidion_Adult::OnFarmEvent(), THare::OnFarmEvent(), Hare_Infant::OnFarmEvent(), Hare_Young::OnFarmEvent(), Skylark_Clutch::OnFarmEvent(), Skylark_Nestling::OnFarmEvent(), Skylark_PreFledgeling::OnFarmEvent(), Skylark_Female::OnFarmEvent(), Skylark_Male::OnFarmEvent(), Partridge_Female::OnMating(), Partridge_Covey::Partridge_Covey(), Partridge_Female::Partridge_Female(), Partridge_Male::Partridge_Male(), Pesticide::Pesticide(), TPredator_Population_Manager::PredAutumnSample(), TPredator_Population_Manager::PredSampleFile(), TPredator_Population_Manager::PredSpringAutumnSample(), TPredator_Population_Manager::PredSpringSample(), SkTerritories::PrePolyNQual(), Rabbit_Population_Manager::PreProcessWarrenLocations(), Farm::ProductApplication_DateLimited(), Rabbit_Population_Manager::Rabbit_Population_Manager(), Rabbit_Warren::Rabbit_Warren(), Landscape::ReadPolys2(), Skylark_Nestling::ReInit(), Vole_Female::ReInit(), RodenticideManager::RodenticideManager(), RodenticidePredators_Population_Manager::RodenticidePredators_Population_Manager(), Hunter_Population_Manager::RuleSet10Based(), Population_Manager::Run(), TPredator_Population_Manager::Run(), THare::Running(), Hunter_Population_Manager::SetHuntingSeason(), Skylark_Nestling::Skylark_Nestling(), Skylark_Population_Manager::Skylark_Population_Manager(), Goose_Base::st_ChooseForageLocation(), Bembidion_Larvae::st_Develop(), Hare_Infant::st_Developing(), Hare_Young::st_Developing(), Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), Hare_Female::st_Developing(), Hare_Juvenile::st_Dispersal(), Vole_JuvenileMale::st_Eval_n_Explore(), Vole_JuvenileFemale::st_Evaluate_n_Explore(), Vole_Female::st_Evaluate_n_Explore(), Goose_Base::st_Forage(), GooseHunter::st_OutHunting(), Hare_Female::st_ReproBehaviour(), Vole_Female::st_Special_Explore(), Bembidion_Adult::Step(), Partridge_Population_Manager::TestShouldFlock(), THare::THareInit(), Goose_Population_Manager::TheAOROutputProbe(), Landscape::Tick(), CoveyManager::Tick(), RodenticideManager::Tick(), TPredator_Population_Manager::TPredator_Population_Manager(), UnsprayedFieldMargin::UnsprayedFieldMargin(), Landscape::UnsprayedMarginAdd(), Rabbit_Warren::UpdateForageInformation(), Hare_Female::UpdateOestrous(), Vole_Female::Vole_Female(), THare::WasPredated(), Weasel::Weasel(), Weather::Weather(), and Goose_Population_Manager::WriteConfig().

Member Data Documentation

◆ m_int

int CfgInt::m_int
protected

Referenced by CfgInt(), and set().

◆ m_max

int CfgInt::m_max
protected

Referenced by CfgInt(), and set().

◆ m_min

int CfgInt::m_min
protected

Referenced by CfgInt(), and set().


The documentation for this class was generated from the following files: